Optimal. Leaf size=95 \[ -\frac {12 c^4 x}{a}-\frac {12 i c^4 \log (\cos (e+f x))}{a f}+\frac {5 c^4 \tan (e+f x)}{a f}-\frac {i c^4 \tan ^2(e+f x)}{2 a f}+\frac {8 i c^4}{f (a+i a \tan (e+f x))} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.09, antiderivative size = 95, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 3, integrand size = 31, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.097, Rules used = {3603, 3568, 45}
\begin {gather*} -\frac {i c^4 \tan ^2(e+f x)}{2 a f}+\frac {5 c^4 \tan (e+f x)}{a f}+\frac {8 i c^4}{f (a+i a \tan (e+f x))}-\frac {12 i c^4 \log (\cos (e+f x))}{a f}-\frac {12 c^4 x}{a} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 45
Rule 3568
Rule 3603
Rubi steps
\begin {align*} \int \frac {(c-i c \tan (e+f x))^4}{a+i a \tan (e+f x)} \, dx &=\left (a^4 c^4\right ) \int \frac {\sec ^8(e+f x)}{(a+i a \tan (e+f x))^5} \, dx\\ &=-\frac {\left (i c^4\right ) \text {Subst}\left (\int \frac {(a-x)^3}{(a+x)^2} \, dx,x,i a \tan (e+f x)\right )}{a^3 f}\\ &=-\frac {\left (i c^4\right ) \text {Subst}\left (\int \left (5 a-x+\frac {8 a^3}{(a+x)^2}-\frac {12 a^2}{a+x}\right ) \, dx,x,i a \tan (e+f x)\right )}{a^3 f}\\ &=-\frac {12 c^4 x}{a}-\frac {12 i c^4 \log (\cos (e+f x))}{a f}+\frac {5 c^4 \tan (e+f x)}{a f}-\frac {i c^4 \tan ^2(e+f x)}{2 a f}+\frac {8 i c^4}{f (a+i a \tan (e+f x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Both result and optimal contain complex but leaf count is larger than twice
the leaf count of optimal. \(194\) vs. \(2(95)=190\).
time = 2.08, size = 194, normalized size = 2.04 \begin {gather*} \frac {c^4 \cos (e) \sec (e+f x) (\cos (f x)+i \sin (f x)) \left (-24 f x-12 i \log \left (\cos ^2(e+f x)\right )+24 f x \sec ^2(e)-i \sec ^2(e+f x)+10 \sec (e) \sec (e+f x) \sin (f x)+8 \sin (2 f x)+12 \log \left (\cos ^2(e+f x)\right ) \tan (e)+\sec ^2(e+f x) \tan (e)+10 i \sec (e) \sec (e+f x) \sin (f x) \tan (e)-8 i \sin (2 f x) \tan (e)-24 f x \tan ^2(e)-24 i \text {ArcTan}(\tan (f x)) (-i+\tan (e))+8 \cos (2 f x) (i+\tan (e))\right )}{2 f (a+i a \tan (e+f x))} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.16, size = 57, normalized size = 0.60
method | result | size |
derivativedivides | \(\frac {c^{4} \left (5 \tan \left (f x +e \right )-\frac {i \left (\tan ^{2}\left (f x +e \right )\right )}{2}+\frac {8}{\tan \left (f x +e \right )-i}+12 i \ln \left (\tan \left (f x +e \right )-i\right )\right )}{f a}\) | \(57\) |
default | \(\frac {c^{4} \left (5 \tan \left (f x +e \right )-\frac {i \left (\tan ^{2}\left (f x +e \right )\right )}{2}+\frac {8}{\tan \left (f x +e \right )-i}+12 i \ln \left (\tan \left (f x +e \right )-i\right )\right )}{f a}\) | \(57\) |
risch | \(\frac {4 i c^{4} {\mathrm e}^{-2 i \left (f x +e \right )}}{a f}-\frac {24 c^{4} x}{a}-\frac {24 c^{4} e}{a f}+\frac {2 i c^{4} \left (4 \,{\mathrm e}^{2 i \left (f x +e \right )}+5\right )}{f a \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{2}}-\frac {12 i c^{4} \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )}{a f}\) | \(106\) |
norman | \(\frac {\frac {17 i c^{4}}{2 a f}-\frac {12 c^{4} x}{a}+\frac {5 c^{4} \left (\tan ^{3}\left (f x +e \right )\right )}{a f}-\frac {12 c^{4} x \left (\tan ^{2}\left (f x +e \right )\right )}{a}+\frac {13 c^{4} \tan \left (f x +e \right )}{a f}-\frac {i c^{4} \left (\tan ^{4}\left (f x +e \right )\right )}{2 a f}}{1+\tan ^{2}\left (f x +e \right )}+\frac {6 i c^{4} \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{a f}\) | \(133\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: RuntimeError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 179 vs. \(2 (89) = 178\).
time = 1.01, size = 179, normalized size = 1.88 \begin {gather*} -\frac {2 \, {\left (12 \, c^{4} f x e^{\left (6 i \, f x + 6 i \, e\right )} - 2 i \, c^{4} + 6 \, {\left (4 \, c^{4} f x - i \, c^{4}\right )} e^{\left (4 i \, f x + 4 i \, e\right )} + 3 \, {\left (4 \, c^{4} f x - 3 i \, c^{4}\right )} e^{\left (2 i \, f x + 2 i \, e\right )} + 6 \, {\left (i \, c^{4} e^{\left (6 i \, f x + 6 i \, e\right )} + 2 i \, c^{4} e^{\left (4 i \, f x + 4 i \, e\right )} + i \, c^{4} e^{\left (2 i \, f x + 2 i \, e\right )}\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right )\right )}}{a f e^{\left (6 i \, f x + 6 i \, e\right )} + 2 \, a f e^{\left (4 i \, f x + 4 i \, e\right )} + a f e^{\left (2 i \, f x + 2 i \, e\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.28, size = 175, normalized size = 1.84 \begin {gather*} \frac {8 i c^{4} e^{2 i e} e^{2 i f x} + 10 i c^{4}}{a f e^{4 i e} e^{4 i f x} + 2 a f e^{2 i e} e^{2 i f x} + a f} + \begin {cases} \frac {4 i c^{4} e^{- 2 i e} e^{- 2 i f x}}{a f} & \text {for}\: a f e^{2 i e} \neq 0 \\x \left (\frac {24 c^{4}}{a} + \frac {\left (- 24 c^{4} e^{2 i e} + 8 c^{4}\right ) e^{- 2 i e}}{a}\right ) & \text {otherwise} \end {cases} - \frac {24 c^{4} x}{a} - \frac {12 i c^{4} \log {\left (e^{2 i f x} + e^{- 2 i e} \right )}}{a f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 200 vs. \(2 (89) = 178\).
time = 0.66, size = 200, normalized size = 2.11 \begin {gather*} \frac {2 \, {\left (-\frac {6 i \, c^{4} \log \left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 1\right )}{a} + \frac {12 i \, c^{4} \log \left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - i\right )}{a} - \frac {6 i \, c^{4} \log \left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 1\right )}{a} - \frac {13 \, c^{4} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{5} - 9 i \, c^{4} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{4} - 24 \, c^{4} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} + 9 i \, c^{4} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 13 \, c^{4} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )}{{\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} - i \, \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + i\right )}^{2} a}\right )}}{f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 4.68, size = 85, normalized size = 0.89 \begin {gather*} \frac {5\,c^4\,\mathrm {tan}\left (e+f\,x\right )}{a\,f}+\frac {c^4\,8{}\mathrm {i}}{a\,f\,\left (1+\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )}-\frac {c^4\,{\mathrm {tan}\left (e+f\,x\right )}^2\,1{}\mathrm {i}}{2\,a\,f}+\frac {c^4\,\ln \left (\mathrm {tan}\left (e+f\,x\right )-\mathrm {i}\right )\,12{}\mathrm {i}}{a\,f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________